package com.ccys.db.entity;

import com.ccys.db.rely.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Created by Mybatis Generator on 2023/12/08
*/
@Data
@ApiModel("后台账号")
@Table(name = "tbl_account")
@NoArgsConstructor
@AllArgsConstructor
public class TblAccount extends BaseEntity {
    @Column(name = "role_ids")
    private String roleIds;

    @Column(name = "role_name")
    private String roleName;

    @Column(name = "group_id")
    private String groupId;

    @Column(name = "company_id")
    private String companyId;

    @Column(name = "clinic_id")
    private String clinicId;

    @Column(name = "pharmacy_id")
    private String pharmacyId;

    /**
     * dev:开发者 ; administrator:超管;admin:普通管理员
     */
    @Column(name = "user_type")
    private String userType;

    @Column(name = "user_code")
    private String userCode;

    @Column(name = "user_name")
    private String userName;

    @Column(name = "user_password")
    private String userPassword;

    @Column(name = "user_fullname")
    private String userFullname;

    @Column(name = "user_email")
    private String userEmail;

    @Column(name = "user_address")
    private String userAddress;

    @Column(name = "user_phone")
    private String userPhone;

    /**
     * 最后一次登录时间
     */
    @Column(name = "user_last_visit")
    @ApiModelProperty("最后一次登录时间")
    private Date userLastVisit;

    /**
     * 最后一次修改密码时间
     */
    @Column(name = "user_last_password_changed")
    @ApiModelProperty("最后一次修改密码时间")
    private Date userLastPasswordChanged;

    /**
     * 最后一次被锁定时间
     */
    @Column(name = "user_last_locked_out")
    @ApiModelProperty("最后一次被锁定时间")
    private Date userLastLockedOut;

    /**
     * 密码错误次数
     */
    @Column(name = "user_failed_password_count")
    @ApiModelProperty("密码错误次数")
    private Integer userFailedPasswordCount;

    @Column(name = "user_status")
    private Integer userStatus;

    /**
     * 登录状态，如果密码错误 3 次，锁定账号  0 锁定，1正常
     */
    @Column(name = "user_login_status")
    @ApiModelProperty("登录状态，如果密码错误 3 次，锁定账号")
    private Integer userLoginStatus;

    @Column(name = "user_image")
    private String userImage;

    /**
     * 请求邮箱验证码的时间
     */
    @Column(name = "user_request_otp_utc_time")
    @ApiModelProperty("请求邮箱验证码的时间")
    private Date userRequestOtpUtcTime;

    /**
     * 6 位邮箱验证码
     */
    @Column(name = "user_otp")
    @ApiModelProperty("6 位邮箱验证码")
    private String userOtp;

    @Transient
    private String token;
}